﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using TyMES.Model;

namespace TyMES.Model.BaseInformation
{
    /// <summary>
    /// 原料管理
    /// </summary>
	[Table("T_Materials")]
    [SoftKey(nameof(Material.MaterialCode))]
    [Display(Name = "_Model.Material")]
    public class Material : BasePoco,IPersistPoco
    {
        [Display(Name = "_Model._Material._MaterialCode")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("物料编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string MaterialCode { get; set; }
        [Display(Name = "_Model._Material._MaterialType")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("物料类型")]
        public string MaterialType { get; set; }
        [Display(Name = "_Model._Material._MaterialName")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("物料名称")]
        public string MaterialName { get; set; }
        [Display(Name = "_Model._Material._MaterialVersion")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("物料版本")]
        public string MaterialVersion { get; set; }
        [Display(Name = "_Model._Material._MeasureUnitCode")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("计量单位")]
        public string MeasureUnitCode { get; set; }
        [Display(Name = "_Model._Material._Regular")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("正则校验")]
        public string Regular { get; set; }
        [Display(Name = "_Model._Material._ShipRegular")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("出货条码正则校验")]
        public string ShipRegular { get; set; }
        [Display(Name = "_Model._Material._MachineStatus")]
        [Comment("物料状态")]
        public BaseStatusEnum? MachineStatus { get; set; }
        [Display(Name = "_Model._Material._Field1")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("预留域1")]
        public string Field1 { get; set; }
        [Display(Name = "_Model._Material._Field2")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("预留域2")]
        public string Field2 { get; set; }
        [Display(Name = "_Model._Material._Field3")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("预留域3")]
        public string Field3 { get; set; }
        [Display(Name = "_Model._Material._Field4")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("预留域4")]
        public string Field4 { get; set; }
        [Display(Name = "_Model._Material._Field5")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("预留域5")]
        public string Field5 { get; set; }
        [Display(Name = "_Model._Material._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;

	}

}
